Optimal. Leaf size=31 \[ \frac{(a+b) \log (\cosh (c+d x))}{d}-\frac{b \tanh ^2(c+d x)}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0319005, antiderivative size = 31, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.105, Rules used = {3631, 3475} \[ \frac{(a+b) \log (\cosh (c+d x))}{d}-\frac{b \tanh ^2(c+d x)}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3631
Rule 3475
Rubi steps
\begin{align*} \int \tanh (c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx &=-\frac{b \tanh ^2(c+d x)}{2 d}-(-a-b) \int \tanh (c+d x) \, dx\\ &=\frac{(a+b) \log (\cosh (c+d x))}{d}-\frac{b \tanh ^2(c+d x)}{2 d}\\ \end{align*}
Mathematica [A] time = 0.0234953, size = 41, normalized size = 1.32 \[ \frac{a \log (\cosh (c+d x))}{d}-\frac{b \tanh ^2(c+d x)}{2 d}+\frac{b \log (\cosh (c+d x))}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.004, size = 76, normalized size = 2.5 \begin{align*} -{\frac{b \left ( \tanh \left ( dx+c \right ) \right ) ^{2}}{2\,d}}-{\frac{\ln \left ( \tanh \left ( dx+c \right ) -1 \right ) a}{2\,d}}-{\frac{\ln \left ( \tanh \left ( dx+c \right ) -1 \right ) b}{2\,d}}-{\frac{\ln \left ( \tanh \left ( dx+c \right ) +1 \right ) a}{2\,d}}-{\frac{\ln \left ( \tanh \left ( dx+c \right ) +1 \right ) b}{2\,d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 1.69827, size = 103, normalized size = 3.32 \begin{align*} b{\left (x + \frac{c}{d} + \frac{\log \left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}{d} + \frac{2 \, e^{\left (-2 \, d x - 2 \, c\right )}}{d{\left (2 \, e^{\left (-2 \, d x - 2 \, c\right )} + e^{\left (-4 \, d x - 4 \, c\right )} + 1\right )}}\right )} + \frac{a \log \left (\cosh \left (d x + c\right )\right )}{d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 1.89958, size = 1114, normalized size = 35.94 \begin{align*} -\frac{{\left (a + b\right )} d x \cosh \left (d x + c\right )^{4} + 4 \,{\left (a + b\right )} d x \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} +{\left (a + b\right )} d x \sinh \left (d x + c\right )^{4} +{\left (a + b\right )} d x + 2 \,{\left ({\left (a + b\right )} d x - b\right )} \cosh \left (d x + c\right )^{2} + 2 \,{\left (3 \,{\left (a + b\right )} d x \cosh \left (d x + c\right )^{2} +{\left (a + b\right )} d x - b\right )} \sinh \left (d x + c\right )^{2} -{\left ({\left (a + b\right )} \cosh \left (d x + c\right )^{4} + 4 \,{\left (a + b\right )} \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} +{\left (a + b\right )} \sinh \left (d x + c\right )^{4} + 2 \,{\left (a + b\right )} \cosh \left (d x + c\right )^{2} + 2 \,{\left (3 \,{\left (a + b\right )} \cosh \left (d x + c\right )^{2} + a + b\right )} \sinh \left (d x + c\right )^{2} + 4 \,{\left ({\left (a + b\right )} \cosh \left (d x + c\right )^{3} +{\left (a + b\right )} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right ) + a + b\right )} \log \left (\frac{2 \, \cosh \left (d x + c\right )}{\cosh \left (d x + c\right ) - \sinh \left (d x + c\right )}\right ) + 4 \,{\left ({\left (a + b\right )} d x \cosh \left (d x + c\right )^{3} +{\left ({\left (a + b\right )} d x - b\right )} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right )}{d \cosh \left (d x + c\right )^{4} + 4 \, d \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + d \sinh \left (d x + c\right )^{4} + 2 \, d \cosh \left (d x + c\right )^{2} + 2 \,{\left (3 \, d \cosh \left (d x + c\right )^{2} + d\right )} \sinh \left (d x + c\right )^{2} + 4 \,{\left (d \cosh \left (d x + c\right )^{3} + d \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right ) + d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.319899, size = 60, normalized size = 1.94 \begin{align*} \begin{cases} a x - \frac{a \log{\left (\tanh{\left (c + d x \right )} + 1 \right )}}{d} + b x - \frac{b \log{\left (\tanh{\left (c + d x \right )} + 1 \right )}}{d} - \frac{b \tanh ^{2}{\left (c + d x \right )}}{2 d} & \text{for}\: d \neq 0 \\x \left (a + b \tanh ^{2}{\left (c \right )}\right ) \tanh{\left (c \right )} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.16461, size = 82, normalized size = 2.65 \begin{align*} -\frac{{\left (d x + c\right )}{\left (a + b\right )}}{d} + \frac{{\left (a + b\right )} \log \left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}{d} + \frac{2 \, b e^{\left (2 \, d x + 2 \, c\right )}}{d{\left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]